﻿@model Sis.Entities.VentaRegistrada

@{
    ViewBag.Title = "Create";
}
<script type="text/javascript">
    $(document).ready(function () {
        $("#NVoucher").keypress(function (e) {

            if (e.shiftKey) {
                e.preventDefault();
            }
            else {
                var key = window.Event ? e.which : e.keyCode;
                return ((key >= 48 && key <= 57) || (key == 8) || (key == 13));

            }
        });
        $("#NEquifax").keypress(function (e) {

            if (e.shiftKey) {
                e.preventDefault();
            }
            else {
                var key = window.Event ? e.which : e.keyCode;
                return ((key >= 48 && key <= 57) || (key == 8) || (key == 13));

            }
        });
        $("#NDeposito").keypress(function (e) {

            if (e.shiftKey) {
                e.preventDefault();
            }
            else {
                var key = window.Event ? e.which : e.keyCode;
                return ((key >= 48 && key <= 57) || (key == 8) || (key == 13));

            }
        });
        $("#NSolicitud").keypress(function (e) {

            if (e.shiftKey) {
                e.preventDefault();
            }
            else {
                var key = window.Event ? e.which : e.keyCode;
                return ((key >= 48 && key <= 57) || (key == 8) || (key == 13));

            }
        });
        $("#DniRuc").keypress(function (e) {

            if (e.shiftKey) {
                e.preventDefault();
            }
            else {
                var key = window.Event ? e.which : e.keyCode;
                return ((key >= 48 && key <= 57) || (key == 8) || (key == 13));

            }
        });
        $('#Nombres').keypress(function (e) {
            if ((event.keyCode != 32) && (event.keyCode < 65) || (event.keyCode > 90) && (event.keyCode < 97) || (event.keyCode > 122))
                event.returnValue = false;
        });
        $('#ApPaterno').keypress(function (e) {
            if ((event.keyCode != 32) && (event.keyCode < 65) || (event.keyCode > 90) && (event.keyCode < 97) || (event.keyCode > 122))
                event.returnValue = false;
        });
        $('#ApMaterno').keypress(function (e) {
            if ((event.keyCode != 32) && (event.keyCode < 65) || (event.keyCode > 90) && (event.keyCode < 97) || (event.keyCode > 122))
                event.returnValue = false;
        });
        $('#Marca').keypress(function (e) {
            if ((event.keyCode != 32) && (event.keyCode < 65) || (event.keyCode > 90) && (event.keyCode < 97) || (event.keyCode > 122))
                event.returnValue = false;
        });
        $('#Modelo').keypress(function (e) {
            if ((event.keyCode != 32) && (event.keyCode < 65) || (event.keyCode > 90) && (event.keyCode < 97) || (event.keyCode > 122))
                event.returnValue = false;
        }); 
        $("#NTelefonico").keypress(function (e) {

            if (e.shiftKey) {
                e.preventDefault();
            }
            else {
                var key = window.Event ? e.which : e.keyCode;
                return ((key >= 48 && key <= 57) || (key == 8) || (key == 13));

            }
        });
    });
</script>

@using (Html.BeginForm()) {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    
    <h1>Nuevo Registro</h1>
    <hr>

    <table class="table">
        <tr>
            <td>@Html.LabelFor(model => model.FechaVenta)</td>
            <td>@Html.EditorFor(model => model.FechaVenta)
                @Html.ValidationMessageFor(model => model.FechaVenta)
            </td>
            <td>@Html.LabelFor(model => model.TipoVenta)</td>
            <td>
                @Html.EditorFor(model => model.TipoVenta)
                @Html.ValidationMessageFor(model => model.TipoVenta)
            </td>
            <td>@Html.LabelFor(model => model.NSolicitud)</td>
            <td>
                @Html.EditorFor(model => model.NSolicitud)
                @Html.ValidationMessageFor(model => model.NSolicitud)
            </td>                
        </tr>
        <tr>
            <td>@Html.Label("Promotor")</td>
            <td>
                @*@Html.EditorFor(model => model.IdPromotor)*@
                @Html.DropDownList("IdPromotor", null, new {@data_live_search = "true"})
                @Html.ValidationMessageFor(model => model.IdPromotor)
            </td>
            <td>@Html.LabelFor(model => model.FormaPago)</td>
            <td>
                @Html.EditorFor(model => model.FormaPago)
                @Html.ValidationMessageFor(model => model.FormaPago)
            </td>                
            <td>@Html.LabelFor(model => model.NEquifax)</td>
            <td>
                @Html.EditorFor(model => model.NEquifax)
                @Html.ValidationMessageFor(model => model.NEquifax)
            </td>
        </tr>
        <tr>
            <td>@Html.LabelFor(model => model.NVoucher)</td>
            <td>
                @Html.EditorFor(model => model.NVoucher)
                @Html.ValidationMessageFor(model => model.NVoucher)
            </td>
            <td>@Html.LabelFor(model => model.NDeposito)</td>
            <td>
                @Html.EditorFor(model => model.NDeposito)
                @Html.ValidationMessageFor(model => model.NDeposito)
            </td>
        </tr>
    </table>
    
    <legend>
        <fieldset>Cliente</fieldset>
    </legend> 
    <table class="table">
        <tr>
            <td>@Html.Label("DNI/RUC")</td>
            <td>
                @Html.EditorFor(model => model.DniRuc)
                @Html.ValidationMessageFor(model => model.DniRuc)
            </td>
            <td>@Html.LabelFor(model => model.Nombres)</td>
            <td>
                @Html.EditorFor(model => model.Nombres)
                @Html.ValidationMessageFor(model => model.Nombres)
            </td>           
        </tr>
        <tr>
            <td>@Html.LabelFor(model => model.ApPaterno)</td>
            <td>
                @Html.EditorFor(model => model.ApPaterno)
                @Html.ValidationMessageFor(model => model.ApPaterno)
            </td>
            <td>@Html.LabelFor(model => model.ApMaterno)</td>
            <td>
                @Html.EditorFor(model => model.ApMaterno)
                @Html.ValidationMessageFor(model => model.ApMaterno)
            </td>
            
        </tr>
    </table>
    <legend>
        <fieldset>Equipo</fieldset>
    </legend>
        <table class="table">
            <tr>
                <td>@Html.LabelFor(model => model.Marca)</td>
                <td>
                    @Html.EditorFor(model => model.Marca)
                    @Html.ValidationMessageFor(model => model.Marca)
                </td>
                <td>@Html.LabelFor(model => model.Modelo)</td>
                <td>
                    @Html.EditorFor(model => model.Modelo)
                    @Html.ValidationMessageFor(model => model.Modelo)
                </td>
                <td>@Html.LabelFor(model => model.Nomenclatura)</td>
                <td>
                    @Html.EditorFor(model => model.Nomenclatura)
                    @Html.ValidationMessageFor(model => model.Nomenclatura)
                </td>
            </tr>
            <tr>
                <td>@Html.LabelFor(model => model.NTelefonico)</td>
                <td>
                    @Html.EditorFor(model => model.NTelefonico)
                    @Html.ValidationMessageFor(model => model.NTelefonico)
                </td>
                <td>@Html.Label("Precio")</td>
                <td>
                    @Html.EditorFor(model => model.PrecioPrepago)
                    @Html.ValidationMessageFor(model => model.PrecioPrepago)
                </td>
                <td>@Html.LabelFor(model => model.PrecioVenta)</td>
                <td>
                    @Html.EditorFor(model => model.PrecioVenta)
                    @Html.ValidationMessageFor(model => model.PrecioVenta)
                </td>
            </tr>
        </table>

        <p>
            <button type="submit" value="Guardar" class="btn btn-success" title="Guardar">
                <span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span> Guardar
            </button>
            @Html.ActionLink("  Atras", "Index",null , new{@class="glyphicon glyphicon-arrow-left btn btn-danger"})
        </p>
    
}


@*@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}*@
